/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package operators;

import java.util.List;
import java.util.Map;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author marcin
 */
public class ComplementOperator extends OperatorImpl {

    @Override
    public Double calculateHappiness(Map<String, Double> map) {
        Double max = 0.0;
        Double h1 = 0.0;
        Double h2 = 0.0;
        Object[] array = map.values().toArray();
        h1 = (Double) array[0];
        h1 = (Double) array[1];
        max = 1 - (1 - h1) * (1 - h2);
        System.out.println("Calculating happiness with complementary operator...");
        return max;
    }

    @Override
    public void showDialog(JFrame frame, List<String> inputs) {
        JOptionPane.showMessageDialog(null, "No extra parameters needed.\n");
    }
}
